
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SinhVien_DeleteSinhVien]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SinhVien_DeleteSinhVien]
GO
CREATE PROC sp_SinhVien_DeleteSinhVien
	@MaSV	varchar(10)
AS
BEGIN
	DELETE
	FROM DangKy 
	WHERE MaSV = @MaSV

	DELETE
	FROM ThanhVien 
	WHERE MaSV = @MaSV	

	DELETE
	FROM SinhVien 
	WHERE MaSV = @MaSV	
END

--exec sp_SinhVien_DeleteSinhVien 'sv03' 

--select * from sinhvien
--select * from thanhvien
--select * from dangky